package lab02.test02;

public class Circular {

    //1.属性
    double radius;
    double circumference;
    double area;
    final double π=3.1415926;

    public void setRadius(double radius) {
        this.radius = radius;
    }

    //2.行为
    public double reckonCircumference() {
        circumference = 2 * π * radius;
        return circumference;
    }

    public double reckonArea() {
        area = π * radius * radius;
        return area;
    }

    //3.构造函数
    Circular() {}

    @Override
    public String toString() {

        return "周长：" + circumference + "\n" + "面积：" + area;
    }
}
